﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace dzs.Web
{
    public partial class Welcome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                sendPower();
            }
        }

        private void sendPower()
        {
            if (Session["login"] != null)
            {
                DataSet ds = Session["login"] as DataSet;

                int roles_id = Convert.ToInt32(ds.Tables[0].Rows[0]["roles_id"].ToString());
                //int user_id = Convert.ToInt32(ds.Tables[0].Rows[0]["user_id"].ToString());

                if (roles_id == 2)//仓管员
                {
                    Response.Redirect("~/admin/showin.aspx");
                }
                if (roles_id == 3)//物料员
                {
                    Response.Redirect("~/Outstorage/SubmitProject.aspx");
                }
                if (roles_id == 4)//审核人
                {
                    Response.Redirect("~/Outstorage/ListCheckOutStorage.aspx");
                }
                if (roles_id == 5)//供应管理班长
                {
                    Response.Redirect("~/supply/AddSupply.aspx");
                }
                if (roles_id == 6)//供应管理员
                {
                    Response.Redirect("~/supply/ListTechnical.aspx");
                }
                if (roles_id == 7)//配送班长
                {
                    Response.Redirect("~/admin/distribution/listdis.aspx");
                }
                if (roles_id == 8)//配送管理员
                {
                    Response.Redirect("~/admin/distribution/mylist.aspx");
                }
                if (roles_id == 9)//质量管理班长
                {
                    Response.Redirect("~/admin/tempskd/List.aspx");
                }
                if (roles_id == 10)//质量管理员
                {
                    Response.Redirect("~/admin/tempskd/mylist.aspx");

                }
                //if (roles_id == 11)//供应商关系专工
                //{
                //    Response.Redirect("~/Outstorage/SubmitProject.aspx");
                //}
                if (roles_id == 12)//仓储班长
                {
                    Response.Redirect("~/admin/distribution/listcg.aspx");
                }


              
            }
        }
    }
}